package com.gitee.kinbug.sniper.web.service;

import java.util.List;

import com.gitee.kinbug.sniper.common.enums.CandleEnum;
import com.gitee.kinbug.sniper.common.enums.SymbolEnum;
import com.gitee.kinbug.sniper.common.util.Consts;
import com.gitee.kinbug.sniper.web.data.RealTimeData;
import com.gitee.kinbug.sniper.web.device.Index;
import com.gitee.kinbug.sniper.web.device.SeriesModel;
import com.gitee.kinbug.sniper.web.factory.SymbolFactory;

public class SeriesService extends AService<Index>{

	public SeriesService(SymbolEnum symbol) {
		this.symbol = symbol;
		this.index = new Index(symbol);
		this.seriesModel = new SeriesModel(index);
		SymbolFactory.create(symbol, this);
	}

	@Override
	public Index compute(List<CandleEnum> candles) {
		RealTimeData realTimeData = new RealTimeData(Consts.HUOBI_USDT_SWAP_WS_URL, index);
		realTimeData.cxecute(symbol, candles);
		return index;
	}
}
